<template>
	<view class="classify pageBg">
		<custom-nav-bar title="分类"></custom-nav-bar>
		<view class="content">
			<theme-item v-for="item in classifyList" :key="item._id" :item="item"></theme-item>
		</view>
	</view>
</template>

<script setup>
import { ref } from 'vue';
import { getClassifyApi } from '@/api/apis.js';	
import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'

const classifyList = ref([])

const getClassify = async () => {
	const res = await getClassifyApi({
		pageSize: 15
	})
	classifyList.value = res.data
}

// 分享给好友
onShareAppMessage(() => {
	return {
		title: '咸虾米壁纸 精选推荐',
		path: '/pages/classify/classify',
		imageUrl: '/static/images/xxmLogo.png'
	}
})

// 分享给朋友圈
onShareTimeline(() => {
	return {
		title: '咸虾米壁纸 精选推荐',
		imageUrl: '/static/images/xxmLogo.png'
	}
})

getClassify()
</script>

<style lang="scss" scoped>
.classify {
	.content {
		padding: 30rpx;
		// 网格布局
		display: grid;
		gap: 15rpx;
		grid-template-columns: repeat(3, 1fr);
	}
}
</style>
